#ifndef ERLTRZY_H
#define ERLTRZY_H


#include <string>
#include <pthread.h>
#include "erl_interface.h"
#include "ei.h"
#include "common.h"
#include "zookeper.h"
/*
class ErlException { };
class ErlConnectInitException : public ErlException { };
class ErlConnectException : public ErlException { };
class ErlDisconnectException : public ErlException { };
*/

struct Myerl
{
	Common *common;
	int fd;
	bool alive;
	pthread_t listener_thread;
	char* someone_there;
	ZooKeeper *zooKeeper;
};

int myerl_init(Myerl *myerl, std::string cookie, std::string name, std::string host);

void *myerl_listener(void *arg);

int myerl_launch_listener(Myerl *myerl);

int myerl_finalize(Myerl *myerl);

void myerl_commander(Myerl *myerl, char* command_string);

#endif
